#include <stdio.h>
#include<ctype.h>
int main() {
    char a;
    while (scanf("%c", &a) != EOF)
    {
        getchar();
        if (islower(a))
        {
            printf("%c\n", toupper(a));
        }
        else {
            printf("%c\n", tolower(a));
        }
    }
    return 0;
}